﻿using System.Collections.Specialized;
using System.IO;

namespace MiniAspNetCore
{
    /// <summary>
    /// 响应消息
    /// </summary>
    public class HttpResponse
    {
        private readonly IHttpResponseFeature _feater;

        public HttpResponse(IFeatureCollection feature) => feature.Get<IHttpResponseFeature>();

        /// <summary>
        /// 响应状态码
        /// </summary>
        public int StatuCode => _feater.StatusCode;

        /// <summary>
        /// 响应头
        /// </summary>
        public NameValueCollection Headers => _feater.Headers;

        /// <summary>
        /// 响应体
        /// </summary>
        public Stream Body => _feater.Body;
    }
}
